home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The X-Philes (2nd Revision)
/
The X-Philes Number 1 (1995).iso
/
xphiles
/
coding
/
dsp
/
c30ug.exe
/
$LATICE.ASM
< prev
next >
Wrap
Assembly Source File
|
1988-03-26
|
3KB
|
86 lines
;**************************************************************
;
; $latice.asm
;
; staff
;
; 03-26-88
;
; (C) Texas Instruments Inc., 1992
;
; Refer to the file 'license.txt' included with this
; this package for usage and license information.
;
;**************************************************************
Example 40. Lattice filter
;
;==============================================================================
; SUBROUTINE L A T I C E
;==============================================================================
; LATICE == LATTICE FILTER (LPC FILTER - SYNTHESIS)
;
;
; TYPICAL CALLING SEQUENCE:
;
; load R2
; load AR0
; load AR1
; load RC
; CALL LATICE
;
;
; ARGUMENT ASSIGNMENTS:
; argument | function
; ---------+-----------------------
; R2 | f(p,n) = e(n) = excitation
; AR0 | address of filter coefficients (k(p))
; AR1 | address of backward propagation values (b(p-1,n-1))
; RC | RC = p - 2
;
; REGISTERS USED AS INPUT: R2, AR0, AR1, RC
; REGISTERS MODIFIED: R0, R1, R2, R3, RS, RE, RC, AR0, AR1
; REGISTER CONTAINING RESULT: R2 (f(0,n))
;
; STACK USAGE: none
;
; PROGRAM SIZE: 12 words
;
; EXECUTION CYCLES: 13 + 5 * (p-1)
;
;==============================================================================
.global LATICE
;
;
LATICE MPYF3 *AR0, *AR1, R0 ; k(p) * b(p-1,n-1) -> R0
SUBF3 R0,R2,R2 ; assume f(p,n) -> R2.
; ; f(p,n)-k(p)*b(p-1,n-1)
; ; =f(p-1,n) -> R2
;
; 2 <= i <= p
;
RPTB LOOP
MPYF3 *AR0,R2,R1 ; k(i) * f(i-1,n) -> R1
MPYF3 *--AR0(1), *-AR1(1), R0 ; k(i-1) * b(i-1-1,n-1) -> R0
ADDF3 *AR1--(1), R1, R3 ; b(i-1,n-1) + k(i) * f(i-1,n)
; ; = b(i,n) -> R3
STF R3, *+AR1(2) ; b(i,n) -> b(i,n-1)
LOOP SUBF3 R0,R2,R2 ; f(i-1,n)-k(i-1)*b(i-1-1,n-1)
; ; = f(i-1-1,n) -> R2
;
;
; i = 1 (cleanup)
;
MPYF3 *AR0, R2, R1 ; k(1) * f(0,n) -> R1
ADDF3 *AR1, R1, R3 ; b(0,n-1) + k(1) * f(0,n)
; ; = b(1,n) -> R3
STF R3, *+AR1(1) ; b(1,n) -> b(1,n-1)
|| STF R2, *AR1 ; f(0,n) -> b(0,n-1)
;
; return sequence
;
RETS ; return
;
; end
;
.end